<template>
	<view class="main animate__fadeInUp" style="animation-duration: 1s;" :key="refreshKey">
		<view>
			<view class="notice-title">{{detail.title}}</view>
			<view class="notice-publish-time">{{detail.publishTime}}</view>
			<view class="notice-content">
				<uv-parse :content="detail.content"></uv-parse>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				detail: '',
				refreshKey:0
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.getDetail();
		},
		onShow(){
			this.refreshKey += 1;
		},
		methods: {
			getDetail() {
				var that = this;
				uni.$uv.http.get('/newsInformation/findById', {
					params: {
						id: that.id
					}
				}).then(res => {
					that.detail = res.data;
				});
			},
		}
	}
</script>

<style>
page {
	height: auto !important;
	background-color: #f9f9f9;
}
.main{
	width: 100vw;
	height: 100vh;
	overflow-y: scroll;
	margin: 0 30rpx 0 30rpx;
	padding-top: 30rpx;
}
	.notice-content {
		color: hsl(0, 2%, 42%);
	}

	.notice-publish-time {
		font-size: 24rpx;
		color: #888;
		line-height: 3;
		padding-bottom: 24rpx;
	}

	.notice-title {
		font-size: 39rpx;
		color: #000
	}

</style>